{namespace Turtle.soy}

/**
 * This is a Closure Template.
 *
 * To regenerate just English, run:
 *   make turtle-en
 *
 * To regenerate all languages, run:
 *   make languages
 */

/**
 * Translated messages for use in JavaScript.
 */
{template .messages}
  {call BlocklyGames.soy.messages /}
  <div style="display: none">
    // Block text and their associated tooltips and URLs (interleaved to
    // assist with translation).
    <span id="Turtle_moveTooltip">{msg meaning="Turtle.moveTooltip" desc="tooltip - In this and subsequent messages, 'turtle' refers to a stylized turtle on the screen to represent a position and direction.  This imaginary turtle is carrying a pen in its tail, so moving the turtle draws a line (or curve, etc.).  You are encouraged to play with the [https://blockly-demo.appspot.com/static/apps/turtle/index.html Turtle application] before doing this translation."}Moves the turtle forward or backward by the specified amount.{/msg}</span>
    <span id="Turtle_moveForward">{msg meaning="Turtle.moveForward" desc="[[Translating:Blockly#Drop-Down_Menus dropdown]] - Infinitive or imperative of a verb telling a turtle to move (walk) in the direction he/she is facing.  This is followed by a number indicating how far (how many pixels) to go.  Prefer a translation that has text in common with the translation of 'move backward'.  See [[Translating:Blockly#Drop-Down_Menus]]."}move forward by{/msg}</span>
    <span id="Turtle_moveBackward">{msg meaning="Turtle.moveBackward" desc="[[Translating:Blockly#Drop-Down_Menus dropdown]] - Infinitive or imperative of a verb telling a turtle to move (walk) in the direction opposite to where he/she is facing.  This is followed by a number indicating how far (how many pixels) to go.  Prefer a translation that has text in common with the translation of 'move forward'."}move backward by{/msg}</span>

    <span id="Turtle_turnTooltip">{msg meaning="Turtle.turnTooltip" desc="'Left' means counter-clockwise/anti-clockwise, and 'right' means clockwise."}Turns the turtle left or right by the specified number of degrees.{/msg}</span>
    <span id="Turtle_turnRight">{msg meaning="Turtle.turnRight" desc="[[Translating:Blockly#Drop-Down_Menus dropdown]] - Infinitive or imperative of verb telling a turtle to rotate clockwise.  This is followed by a number indicating how far (how many degrees) to turn.  Prefer a translation that has text in common with the translation of 'turn left by'."}turn right by{/msg}</span>
    <span id="Turtle_turnLeft">{msg meaning="Turtle.turnLeft" desc="[[Translating:Blockly#Drop-Down_Menus dropdown]] - Infinitive or imperative of verb telling a turtle to rotate counter-clockwise (anti-clockwise).  This is followed by a number indicating how far (how many degrees) to turn.  Prefer a translation that has text in common with the translation of 'turn right by'."}turn left by{/msg}</span>

    <span id="Turtle_widthTooltip">{msg meaning="Turtle.widthTooltip" desc="tooltip"}Changes the width of the pen.{/msg}</span>
    <span id="Turtle_setWidth">{msg meaning="Turtle.setWidth" desc="block text - Infinitive or imperative of a verb to set the width of the lines that should be drawn in the future by an imaginary pen.  This is followed by a number indicating the width in pixels (1 or greater)."}set width to{/msg}</span>

    <span id="Turtle_colourTooltip">{msg meaning="Turtle.colourTooltip" desc="tooltip - Changes the colour of ink in the pen carried by the turtle."}Changes the colour of the pen.{/msg}</span>
    <span id="Turtle_setColour">{msg meaning="Turtle.setColour" desc="block text - Infinitive or imperative of a verb to specify the colour of the lines that should be drawn in the future by an imaginary pen.  This is followed by a block showing the colour"}set colour to{/msg}</span>

    <span id="Turtle_penTooltip">{msg meaning="Turtle.penTooltip" desc="tooltip - Lifting the pen off the writing surface prevents anything from being drawn.  Lowering it (after it has been lifted) enables it to draw again."}Lifts or lowers the pen, to stop or start drawing.{/msg}</span>
    <span id="Turtle_penUp">{msg meaning="Turtle.penUp" desc="block text - Infinitive or imperative of a verb to lift up a pen so that moving it leaves no mark on the writing surface."}pen up{/msg}</span>
    <span id="Turtle_penDown">{msg meaning="Turtle.penDown" desc="block text - Infinitive or imperative of a verb to lower a raised pen so that moving it leaves a mark on the writing surface."}pen down{/msg}</span>

    <span id="Turtle_turtleVisibilityTooltip">{msg meaning="Turtle.turtleVisibilityTooltip" desc="tooltip"}Makes the turtle (circle and arrow) visible or invisible.{/msg}</span>
    <span id="Turtle_hideTurtle">{msg meaning="Turtle.hideTurtle" desc="block text - Infinitive or imperative of a verb telling a turtle to hide itself (become invisible)."}hide turtle{/msg}</span>
    <span id="Turtle_showTurtle">{msg meaning="Turtle.showTurtle" desc="block text - Infinitive or imperative of a verb telling a turtle to show itself (become visible after having been invisible)."}show turtle{/msg}</span>

    <span id="Turtle_printHelpUrl">{{msg meaning="Turtle.printHelpUrl" desc="{lb}{lb}Optional{rb}{rb} URL - Information about printing or typography."}}https://en.wikipedia.org/wiki/Printing{{/msg}}</span>
    <span id="Turtle_printTooltip">{msg meaning="Turtle.printTooltip" desc="tooltip - Note that 'print' refers to displaying text on the screen, not on an external printer."}Draws text in the turtle's direction at its location.{/msg}</span>
    <span id="Turtle_print">{{msg meaning="Turtle.print" desc="block text - Infinitive or imperative of a verb telling a turtle to display text on the screen.  This is always followed by a block indicating what should be printed.\n{lb}{lb}Identical|Print{rb}{rb}"}}print{{/msg}}</span>

    <span id="Turtle_fontHelpUrl">{{msg meaning="Turtle.fontHelpUrl" desc="{lb}{lb}Optional{rb}{rb} URL - Information about typographic fonts."}}https://en.wikipedia.org/wiki/Font{{/msg}}</span>
    <span id="Turtle_fontTooltip">{msg meaning="Turtle.fontTooltip" desc="tooltip - This is shown on the block that lets the user specify the font [family], size, and style that should be used for subsequent displays of text."}Sets the font used by the print block.{/msg}</span>
    <span id="Turtle_font">{{msg meaning="Turtle.font" desc="block text - This precedes a dropdown menu specifying the typographic font [family] that should be used when displaying text.\n{lb}{lb}Identical|Font{rb}{rb}"}}font{{/msg}}</span>
    <span id="Turtle_fontSize">{{msg meaning="Turtle.fontSize" desc="block text - This precedes a number specifying the size of the typographic font that should be used when displaying text.  This appears in the same block as 'font', so that word should not be repeated.\n{lb}{lb}Identical|Font size{rb}{rb}"}}font size{{/msg}}</span>
    <span id="Turtle_fontNormal">{msg meaning="Turtle.fontNormal" desc="[[Translating:Blockly#Drop-Down_Menus dropdown]] - Specifies that a typographic font should be normal (neither in italics or bold)."}normal{/msg}</span>
    <span id="Turtle_fontBold">{msg meaning="Turtle.fontBold" desc="[[Translating:Blockly#Drop-Down_Menus dropdown]] - Specifies that a typographic font should be [https://en.wikipedia.org/wiki/Emphasis_(typography) bold]."}bold{/msg}</span>
    <span id="Turtle_fontItalic">{msg meaning="Turtle.fontItalic" desc="[[Translating:Blockly#Drop-Down_Menus dropdown]] - Specifies that a typographic font should be [https://en.wikipedia.org/wiki/Italics italic]."}italic{/msg}</span>

    <span id="Turtle_submitDisabled">{msg meaning="Turtle.submitDisabled" desc="Error message."}Run your program until it stops. Then you may submit your drawing to the gallery.{/msg}</span>
  </div>
{/template}

/**
 * Web page structure.
 */
{template .start}
  {call .messages /}
  <table width="100%">
    <tr>
      <td>
        <h1>
          {call BlocklyGames.soy.titleSpan}
            {param appName}
              {msg meaning="Games.turtle" desc="IBID"}Turtle{/msg}
            {/param}
          {/call}
          {call BlocklyGames.soy.levelLinks}
            {param level: $ij.level /}
            {param maxLevel: $ij.maxLevel /}
            {param lang: $ij.lang /}
            {param suffix}{/param}
          {/call}
        </h1>
      </td>
      <td class="farSide">
        <select id="languageMenu"></select>
        &nbsp;
        <button id="linkButton" title="{msg meaning="Games.linkTooltip" desc="IBID"}Save and link to blocks.{/msg}">
          <img src="common/1x1.gif" class="link icon21">
        </button>
        &nbsp;
        <button id="helpButton">
          {{msg meaning="Games.help" desc="IBID"}}Help{{/msg}}
        </button>
      </td>
    </tr>
  </table>
  <div id="visualization">
    <canvas id="scratch" width="400" height="400" style="display: none"></canvas>
    <canvas id="answer" width="400" height="400" style="display: none"></canvas>
    <canvas id="display" width="400" height="400"></canvas>
  </div>
  <table style="padding-top: 1em;">
    <tr>
      <td style="width: 190px; text-align: center; vertical-align: top;">
        <svg
            id="slider"
            xmlns="http://www.w3.org/2000/svg"
            xmlns:svg="http://www.w3.org/2000/svg"
            xmlns:xlink="http://www.w3.org/1999/xlink"
            version="1.1"
            width="150"
            height="50">
          <!-- Slow icon. -->
          <clipPath id="slowClipPath">
            <rect width=26 height=12 x=5 y=14 />
          </clipPath>
          <image xlink:href="turtle/icons.png" height=42 width=84 x=-21 y=-10
              clip-path="url(#slowClipPath)" />
          <!-- Fast icon. -->
          <clipPath id="fastClipPath">
            <rect width=26 height=16 x=120 y=10 />
          </clipPath>
          <image xlink:href="turtle/icons.png" height=42 width=84 x=120 y=-11
              clip-path="url(#fastClipPath)" />
        </svg>
      </td>
      <td style="width: 15px;">
        <img id="spinner" style="visibility: hidden;" src="common/loading.gif" height=15 width=15>
      </td>
      <td style="width: 190px; text-align: center">
        <button id="runButton" class="primary" title="{msg meaning="Games.runTooltip" desc="IBID"}Run the program you wrote.{/msg}">
          <img src="common/1x1.gif" class="run icon21"> {msg meaning="Games.runProgram" desc="IBID"}Run Program{/msg}
        </button>
        <button id="resetButton" class="primary" style="display: none" title="{msg meaning="Games.resetTooltip" desc="IBID"}Stop the program and reset the level.{/msg}">
          <img src="common/1x1.gif" class="stop icon21"> {msg meaning="Games.resetProgram" desc="IBID"}Reset{/msg}
        </button>
      </td>
    </tr>
  </table>
  {if $ij.level == 10 and not $ij.html}
  <table style="padding-top: 1em; width: 400px;">
    <tr>
      <td style="text-align: center;">
        <form action="/gallery" target="turtle-gallery">
          <input type="hidden" name="app" value="turtle">
          <input type="hidden" name="lang" value="{$ij.lang}">
          <button type="submit" title="{msg meaning="Turtle.galleryTooltip" desc="tooltip - Pressing this button opens a gallery of drawings made by other users."}Open the gallery of drawings.{/msg}">
            <img src="common/1x1.gif" class="gallery icon21"> {msg meaning="Turtle.galleryMsg" desc="Label on a button that opens a gallery of drawings made by other users."}See Gallery{/msg}
          </button>
        </form>
      </td>
      <td style="text-align: center;">
        <button id="submitButton" title="{msg meaning="Turtle.submitTooltip" desc="tooltip - Pressing this button causes the drawing created by the user's program to be submitted to a gallery for other people to see."}Submit your drawing to the gallery.{/msg}">
          <img src="common/1x1.gif" class="camera icon21"> {msg meaning="Turtle.submitMsg" desc="Label on a button that submits the user's art to a public gallery."}Submit to Gallery{/msg}
        </button>
      </td>
    </tr>
  </table>
  <div id="galleryDialog" class="dialogHiddenContent">
     <form id="galleryForm" action="/gallery-api/submit" method="post" onsubmit="return false">
      <header>{msg meaning="Turtle.submitTooltip" desc="IBID"}Submit your drawing to the gallery.{/msg}</header>
      <canvas id="thumbnail" width="200" height="200"></canvas>
      <input type="hidden" name="app" value="turtle">
      <input id="galleryThumb" type="hidden" name="thumb">
      <input id="galleryXml" type="hidden" name="xml">
      <div>
        {msg meaning="Games.submitTitle" desc="IBID"}Title:{/msg}
        {sp}
        <input id="galleryTitle" type="text" name="title" required>
      </div>
      <footer><!--Legal disclaimer goes here if needed.--></footer>

      <div class="farSide">
        <button id="galleryCancel" type="button">
          {{msg meaning="Games.dialogCancel" desc="IBID"}}Cancel{{/msg}}
        </button>
        <button id="galleryOk" class="secondary" type="submit">
          {{msg meaning="Games.dialogOk" desc="IBID"}}OK{{/msg}}
        </button>
      </div>
    </form>
  </div>
  {/if}

  {call .toolbox /}
  <div id="blockly"></div>

  {call BlocklyGames.soy.dialog /}
  {call BlocklyGames.soy.doneDialog /}
  {call BlocklyGames.soy.abortDialog /}
  {call BlocklyGames.soy.storageDialog /}
  {if $ij.level < 4}
    <div id="helpUseLoop" class="dialogHiddenContent">
      <div style="padding-bottom: 0.7ex">
        {msg meaning="Turtle.helpUseLoop" desc="Dialog telling user to seek a better answer."}
          Your solution works, but you can do better.
        {/msg}
        {sp}
        {if $ij.level < 3}
          {msg meaning="Turtle.helpUseLoop3" desc="Dialog telling user to seek a simpler answer."}
            Draw the shape with just three blocks.
          {/msg}
        {else}
          {msg meaning="Turtle.helpUseLoop4" desc="Dialog telling user to seek a simpler answer."}
            Draw the star with just four blocks.
          {/msg}
        {/if}
      </div>
      {call BlocklyGames.soy.ok /}
    </div>
  {/if}

  <div id="help" class="dialogHiddenContent">
    <div style="padding-bottom: 0.7ex">
      {if $ij.level == 1}
        {msg meaning="Turtle.helpText1" desc="Instructions."}
          Create a program that draws a square.
        {/msg}
        <br><img src="turtle/square.gif" height=146 width=146 style="margin-bottom: -50px">
      {elseif $ij.level == 2}
        {msg meaning="Turtle.helpText2" desc="Instructions."}
          Change your program to draw a pentagon instead of a square.
        {/msg}
      {elseif $ij.level == 3}
        {msg meaning="Turtle.helpText3a" desc="Introducing a new block."}
          There's a new block that allows you to change the colour:
        {/msg}
        <div id="sampleHelp3" class="readonly"></div>
        {msg meaning="Turtle.helpText3b" desc="Instructions."}
          Draw a yellow star.
        {/msg}
      {elseif $ij.level == 4}
        {{msg meaning="Turtle.helpText4a" desc="Introducing a new block.\n\nCross-reference to ensure consistent terminology:\n* {lb}{lb}msg-blockly|Turtle.penTooltip{rb}{rb}"}}
          There's a new block that allows you to lift your pen off the paper when you move:
        {{/msg}}
        <div id="sampleHelp4" class="readonly"></div>
        {msg meaning="Turtle.helpText4b" desc="Instructions."}
          Draw a small yellow star, then draw a line above it.
        {/msg}
      {elseif $ij.level == 5}
        {msg meaning="Turtle.helpText5" desc="Instructions."}
          Instead of one star, can you draw four stars arranged in a square?
        {/msg}
      {elseif $ij.level == 6}
        {msg meaning="Turtle.helpText6" desc="Instructions."}
          Draw three yellow stars, and one white line.
        {/msg}
      {elseif $ij.level == 7}
        {msg meaning="Turtle.helpText7" desc="Instructions."}
          Draw the stars, then draw four white lines.
        {/msg}
      {elseif $ij.level == 8}
        {msg meaning="Turtle.helpText8" desc="Instructions."}
          Drawing 360 white lines will look like the full moon.
        {/msg}
      {elseif $ij.level == 9}
        {msg meaning="Turtle.helpText9" desc="Instructions."}
          Can you add a black circle so that the moon becomes a crescent?
        {/msg}
      {elseif $ij.level == 10}
        {msg meaning="Turtle.helpText10" desc="Instructions."}
          Draw anything you want. You've got a huge number of new blocks you can explore. Have fun!
        {/msg}
        {if not $ij.html}
          <br><br>
          {msg meaning="Turtle.helpText10Reddit" desc="Instructions on publishing your drawing."}
            Use the "See Gallery" button to see what other people have drawn. If you draw something interesting, use the "Submit to Gallery" button to publish it.
          {/msg}
        {/if}
      {/if}
    </div>
    {call BlocklyGames.soy.ok /}
  </div>

  {if $ij.level == 1}
    <div id="helpToolbox" class="dialogHiddenContent">
      <div><img src="turtle/help_left.png" class="mirrorImg" height=23 width=64></div>
      {msg meaning="Turtle.helpToolbox" desc="Instructions for accessing blocks that are hidden inside categories."}
        Choose a category to see the blocks.
      {/msg}
    </div>
  {/if}
{/template}

/**
 * Toolbox.
 */
{template .toolbox}
  <xml id="toolbox" style="display: none">
    {if $ij.level == 10}
      <category name="{msg meaning="Games.turtle" desc="IBID"}Turtle{/msg}">
        <block type="turtle_move">
          <value name="VALUE">
            <shadow type="math_number">
              <field name="NUM">10</field>
            </shadow>
          </value>
        </block>
        <block type="turtle_turn">
          <value name="VALUE">
            <shadow type="math_number">
              <field name="NUM">90</field>
            </shadow>
          </value>
        </block>
        <block type="turtle_width">
          <value name="WIDTH">
            <shadow type="math_number">
              <field name="NUM">1</field>
            </shadow>
          </value>
        </block>
        <block type="turtle_pen"></block>
        <block type="turtle_visibility"></block>
        <block type="turtle_print">
          <value name="TEXT">
            <shadow type="text"></shadow>
          </value>
        </block>
        <block type="turtle_font"></block>
      </category>
      <category name="{msg meaning="Games.catColour" desc="IBID"}Colour{/msg}">
        <block type="turtle_colour">
          <value name="COLOUR">
            <shadow type="colour_picker"></shadow>
          </value>
        </block>
        <block type="colour_picker"></block>
        <block type="colour_random"></block>
        <block type="colour_rgb">
          <value name="RED">
            <shadow type="math_number">
              <field name="NUM">100</field>
            </shadow>
          </value>
          <value name="GREEN">
            <shadow type="math_number">
              <field name="NUM">50</field>
            </shadow>
          </value>
          <value name="BLUE">
            <shadow type="math_number">
              <field name="NUM">0</field>
            </shadow>
          </value>
        </block>
        <block type="colour_blend">
          <value name="COLOUR1">
            <shadow type="colour_picker">
              <field name="COLOUR">#ff0000</field>
            </shadow>
          </value>
          <value name="COLOUR2">
            <shadow type="colour_picker">
              <field name="COLOUR">#3333ff</field>
            </shadow>
          </value>
          <value name="RATIO">
            <shadow type="math_number">
              <field name="NUM">0.5</field>
            </shadow>
          </value>
        </block>
      </category>
      <category name="{msg meaning="Games.catLogic" desc="IBID"}Logic{/msg}">
        <block type="controls_if"></block>
        <block type="logic_compare"></block>
        <block type="logic_operation"></block>
        <block type="logic_negate"></block>
        <block type="logic_boolean"></block>
        <block type="logic_ternary"></block>
      </category>
      <category name="{msg meaning="Games.catLoops" desc="IBID"}Loops{/msg}">
        <block type="controls_repeat_ext">
          <value name="TIMES">
            <shadow type="math_number">
              <field name="NUM">10</field>
            </shadow>
          </value>
        </block>
        <block type="controls_whileUntil"></block>
        <block type="controls_for">
          <value name="FROM">
            <shadow type="math_number">
              <field name="NUM">1</field>
            </shadow>
          </value>
          <value name="TO">
            <shadow type="math_number">
              <field name="NUM">10</field>
            </shadow>
          </value>
          <value name="BY">
            <shadow type="math_number">
              <field name="NUM">1</field>
            </shadow>
          </value>
        </block>
        <block type="controls_flow_statements"></block>
      </category>
      <category name="{msg meaning="Games.catMath" desc="IBID"}Math{/msg}">
        <block type="math_number"></block>
        <block type="math_arithmetic">
          <value name="A">
            <shadow type="math_number">
              <field name="NUM">1</field>
            </shadow>
          </value>
          <value name="B">
            <shadow type="math_number">
              <field name="NUM">1</field>
            </shadow>
          </value>
        </block>
        <block type="math_single">
          <value name="NUM">
            <shadow type="math_number">
              <field name="NUM">9</field>
            </shadow>
          </value>
        </block>
        <block type="math_trig">
          <value name="NUM">
            <shadow type="math_number">
              <field name="NUM">45</field>
            </shadow>
          </value>
        </block>
        <block type="math_constant"></block>
        <block type="math_number_property">
          <value name="NUMBER_TO_CHECK">
            <shadow type="math_number">
              <field name="NUM">0</field>
            </shadow>
          </value>
        </block>
        <block type="math_round">
          <value name="NUM">
            <shadow type="math_number">
              <field name="NUM">3.1</field>
            </shadow>
          </value>
        </block>
        <block type="math_modulo">
          <value name="DIVIDEND">
            <shadow type="math_number">
              <field name="NUM">64</field>
            </shadow>
          </value>
          <value name="DIVISOR">
            <shadow type="math_number">
              <field name="NUM">10</field>
            </shadow>
          </value>
        </block>
        <block type="math_constrain">
          <value name="VALUE">
            <shadow type="math_number">
              <field name="NUM">50</field>
            </shadow>
          </value>
          <value name="LOW">
            <shadow type="math_number">
              <field name="NUM">1</field>
            </shadow>
          </value>
          <value name="HIGH">
            <shadow type="math_number">
              <field name="NUM">100</field>
            </shadow>
          </value>
        </block>
        <block type="math_random_int">
          <value name="FROM">
            <shadow type="math_number">
              <field name="NUM">1</field>
            </shadow>
          </value>
          <value name="TO">
            <shadow type="math_number">
              <field name="NUM">100</field>
            </shadow>
          </value>
        </block>
        <block type="math_random_float"></block>
      </category>
      <sep></sep>
      <category name="{msg meaning="Games.catVariables" desc="IBID"}Variables{/msg}" custom="VARIABLE"></category>
      <category name="{msg meaning="Games.catProcedures" desc="IBID"}Functions{/msg}" custom="PROCEDURE"></category>
    {else}
      <category name="{msg meaning="Games.turtle" desc="IBID"}Turtle{/msg}">
        <block type="turtle_move_internal">
          <field name="VALUE">100</field>
        </block>
        <block type="turtle_turn_internal">
          <field name="VALUE">90</field>
        </block>
        {if $ij.level > 3}
          <block type="turtle_pen"></block>
        {/if}
      </category>
      {if $ij.level > 2}
        <category name="{msg meaning="Games.catColour" desc="IBID"}Colour{/msg}">
          <block type="turtle_colour_internal"></block>
        </category>
      {/if}
      <category name="{msg meaning="Games.catLoops" desc="IBID"}Loops{/msg}">
        <block type="turtle_repeat_internal">
          <field name="TIMES">4</field>
        </block>
      </category>
    {/if}
  </xml>
{/template}
